﻿namespace EasyLib.Patterns.Specification
{
    public class NotSpecification<T> : CompositeSpecification<T>
    {
        private ISpecification<T> wrapped;

        public NotSpecification(ISpecification<T> x)
        {
            wrapped = x;
        }

        public override bool IsSatisfiedBy(T candidate)
        {
            return !wrapped.IsSatisfiedBy(candidate);
        }

    }
}
